import pandas as pd
import matplotlib.pyplot as plt
import seaborn

# number of projects
df = pd.read_csv('employee_data.csv')
number_projects = df.groupby('number_project').count()
print(number_projects)
plt.bar(number_projects.index.values, number_projects['satisfaction_level'])
plt.xlabel('number of projects')
plt.ylabel('employee number')
plt.show()

# Time Spent in Company
# time_spent = data_set.groupby('time_spend_company').count()
# plt.bar(time_spent.index.values, time_spent['satisfaction_level'])
# plt.xlabel('Number of Years Spend in Company')
# plt.ylabel('Number of Employees')
# plt.show()

# Department
# number_dept = data_set.groupby('Departments').count()
# plt.bar(number_dept.index.values, number_dept['satisfaction_level'])
# plt.xlabel('Department')
# plt.ylabel('Number of Employees')
# plt.show()

# Salary
# number_salary = data_set.groupby('salary').count()
# plt.bar(number_salary.index.values, number_salary['satisfaction_level'])
# plt.xlabel('Salary')
# plt.ylabel('Number of Employees')
# plt.show()

# Subplots using Seaborn
features = ['number_project', 'time_spend_company', 'Work_accident', 'Departments', 'salary']
for i, j in enumerate(features):
    plt.subplot(3, 2, i + 1)
    seaborn.countplot(x=j, data=df)
    plt.subplots_adjust(hspace=1.0)
    plt.xticks(rotation=90)

plt.show()
